<template>
  <div
    v-show="isShow"
    id="app"
    :class="$store.state.isMobileAndPc ? 'mobileApp' : 'pcApp'"
  >
    <Index />
  </div>
</template>
<script>
import Index from './views/index.vue';
export default {
  components: { Index },
  name: 'app',
  data() {
    return {
      isShow: false,
    };
  },
  
  beforeCreate() {
    let imgs = [
      'https://static.pdwl.net/jituan/images/digitalMan/icon11.png',
      'https://static.pdwl.net/jituan/images/icon15.png',
      'https://static.pdwl.net/jituan/images/digitalEmployee/icon8.png',
      'https://static.pdwl.net/jituan/images/channel/icon3.png',
      'https://static.pdwl.net/jituan/images/aboutUs/icon8.png',
      'https://static.pdwl.net/jituan/images/aboutUs/icon8.png',
      'https://static.pdwl.net/jituan/images/hx/icon2.png',
    ];
    imgs.forEach((item) => {
      let img = new Image();
      img.src = item;
      img.onload = function () {};
    });
  },
  created() {
    if (sessionStorage.getItem('store')) {
      this.$store.replaceState(
        Object.assign(
          {},
          this.$store.state,
          JSON.parse(sessionStorage.getItem('store'))
        )
      );
    }
    window.addEventListener('beforeunload', () => {
      sessionStorage.setItem('store', JSON.stringify(this.$store.state));
      window.removeEventListener('beforeunload', () => {});
    });
  },
  mounted() {
    this.$nextTick(() => {
      setTimeout(() => {
        this.isShow = true;
      }, 1000);
    });
  },
};
</script>
<style>
@import '@/style/base.css';
body {
  margin: 0;
  padding: 0;
  font-family: 'Microsoft YaHei', '微软雅黑', Arial, Helvetica, sans-serif;
  font-size: 16px;
}
.mobileApp {
  /* background: #F4F7FE; */
  color: #333333;
}
.pcApp {
  background: #000;
  color: #fff;
}
ul,
li {
  list-style: none;
  margin: 0;
  padding: 0;
}
::-webkit-scrollbar {
  display: none;
}
a {
  color: #fff;
  border-bottom: none;
  text-decoration: none;
}
</style>
